package com.ekalenchuk.module.dto.session;

import java.io.Serializable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UserSession implements Serializable {

	private static final long serialVersionUID = 5032634060995780770L;

	private static final Logger logger = LoggerFactory.getLogger(UserSession.class);

	private Long id;

	private String login;

	private String email;

	private String firstName;

	private String lastName;

	private String facebookId;

	private boolean loggedIn = false;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getFacebookId() {
		return facebookId;
	}

	public void setFacebookId(String facebookId) {
		this.facebookId = facebookId;
	}

	public boolean isLoggedIn() {
		return loggedIn;
	}

	public void setLoggedIn(boolean loggedIn) {
		this.loggedIn = loggedIn;
	}

	public void destroy() {
		//logger.info(String.format("-------- Destroy session for user %s, id = %s --------", login, id.toString()));
		setEmail(null);
		setFacebookId(null);
		setFirstName(null);
		setId(null);
		setLastName(null);
		setLoggedIn(false);
		setLogin(null);
	}

}
